#ifndef HRVAS_H
#define HRVAS_H

#include <QWidget>
#include "histogram.h"

namespace Ui {
class HRVAs;
}

class HRVAs : public QWidget
{
    Q_OBJECT

public:
    explicit HRVAs(QWidget *parent = nullptr);
    ~HRVAs();

    void ProHistogram_RR();
    void ProHistogram_HR();
private slots:


    void on_pushButton_exit_clicked();

    void on_pb_TimeDomain_clicked();

    void on_pb_FreqDomain_clicked();

    void on_pb_Scatter_clicked();

    void on_pb_NonLinearDomain_clicked();

    void on_pb_TimeFreqDomain_clicked();

    void on_pb_MentalPressure_clicked();

    void on_pb_Nerval_clicked();

    void on_pushButton_run_clicked();

    void on_pb_ectopicCheck_clicked();

    void on_pc_replace_clicked();

    void on_pb_detrend_clicked();

    void on_pushButton_startComp_clicked();

private:
    Ui::HRVAs *ui;
    QVector<double>rawRRData_x,rawRRData_y;
    QVector<double>proRRData_x,proRRData_y;

    QVector<bool>Ectopic_b;//异位信息
    int rawrr_Len;
    Histogram histogram_RR,histogram_HR;
private:
    void initQcustomPlots();
    void initRRCurve();
    void initControls();
    QVector<double> readLinesToVector(const QString &filePath);
    void initData();
    void UpdateRRGraph(QVector<double> x, QVector<double> y);
    bool readtxtFile(const QString &filePath, QList<double> &x, QList<double> &y);
};

#endif // HRVAS_H
